package com.lpf;

import java.util.ServiceLoader;

public class Main {

    public static void main(String[] args) {
        ServiceLoader<Log> serviceLoader = ServiceLoader.load(Log.class);
        for (Log log : serviceLoader) {
            log.log("JDK SPI");
        }
    }

    // 输出如下:
    // Log4j:JDK SPI
    // Logback:JDK SPI

}